<include file="public:head" />
<include file="public:sep" />
<style type="text/css">
  .layui-nav-tree{width: 200px!important;}
</style>
<div class="layui-container fly-marginTop fly-user-main">
  <include file="ucleft" />

  <div class="site-tree-mobile layui-hide">
    <i class="layui-icon">&#xe602;</i>
  </div>
  <div class="site-mobile-shade"></div>
  
  <div class="site-tree-mobile layui-hide">
    <i class="layui-icon">&#xe602;</i>
  </div>
  <div class="site-mobile-shade"></div>
  
  
  <div class="fly-panel fly-panel-user" pad20>
    <div class="layui-tab layui-tab-brief" lay-filter="user">
      <ul class="layui-tab-title" id="LAY_mine">
        <li class="layui-this" ><a href="{:U('ucenter/index')}">我的资料</a></li>
        <li><a href="{:U('ucenter/setavatar')}">头像设置</a></li>
         <li><a href="{:U('ucenter/setpassword')}">修改密码</a></li>
      </ul>
      <div class="layui-tab-content" style="padding: 20px 0;">
         <form class="layui-form layui-form-pane" action="">
            <div class="layui-form-item" pane>
              <label for="L_username" class="layui-form-label">性别</label>
              <div class="layui-input-block"> <input type="radio" id="id_male" name="gender" title="男" 
                <if condition="$info['gender'] eq 1">checked</if>
                value="1"> <input type="radio" id="id_male" name="gender" title="女" 
                <if condition="$info['gender'] eq 0">checked</if>
                value="0"> <input type="radio" id="id_male" name="gender" title="保密" 
                <if condition="$info['gender'] eq 2">checked</if>
                value="2"> </div>
            </div>
            <div class="layui-form-item">
              <label for="L_username" class="layui-form-label">生日</label>
              <div class="layui-input-inline">
                <input type="text" class="layui-input" name="birthday" id="birthday" placeholder="yyyy-MM-dd">
              </div>
            </div>
            <div class="layui-form-item">
              <label for="L_city" class="layui-form-label">城市</label>
              <div id="citys">
                <div class="layui-input-inline">
                  <select name="province" lay-filter="province">
                  </select>
                </div>
                <div class="layui-input-inline">
                  <select name="city" lay-filter="city">
                  </select>
                </div>
                <div class="layui-input-inline">
                  <select name="county" lay-filter="county">
                  </select>
                </div>
              </div>
            </div>
            <div class="layui-form-item">
              <label for="L_city" class="layui-form-label">联系QQ</label>
              <div class="layui-input-inline">
                <input type="text" name="contact" value="{$info.contact}" class="layui-input" />
              </div>
            </div>
            
            <div class="layui-form-item layui-form-text">
              <label for="L_sign" class="layui-form-label">自我介绍</label>
              <div class="layui-input-block">
                <textarea placeholder="随便写些什么刷下存在感" name="intro" class="layui-textarea" style="height: 80px;">{$info.intro}</textarea>
              </div>
            </div>
            <div class="layui-form-item">
              <button class="layui-btn" key="set-mine" lay-filter="upbtn" lay-submit="">确认修改</button>
            </div>
          </form>
          
           
        </div>

      </div>
    </div>
  </div>

<include file="public:footer" />
<script src="__PUBLIC__/theme/blueideal/mods/jquery.min.js"></script> 
<script src="__PUBLIC__/theme/blueideal/mods/citys.js"></script> 
<script>
layui.use(['form' , 'laydate','jquery','upload'], function(){  
  var form = layui.form , laydate = layui.laydate , $ = layui.jquery , upload = layui.upload;
 
  //初始化时间
  var date = {
    elem: '#birthday'
   ,isInitValue: true
  }

  var value = parseInt('{$info.byear}');
  if (value > 0) {
      date.value = "{$info.byear}-{$info.bmonth}-{$info.bday}";
  }

  laydate.render(date);

  pca.init('select[name=province]', 'select[name=city]', 'select[name=county]', '{$info.province}', '{$info.city}', '{$info.county}');
    
  // 提交基本设置
  form.on('submit(upbtn)', function (data) {
      // 提交到方法 默认为本身
      $.post("{:U('ucenter/index')}",data.field,function(res){
           if(res.status ==  1){
              layer.msg(res.msg,{time:1800},function(){
               location.reload();  //成功后刷新当前页
              });
          }else{
              layer.msg(res.msg,{time:1800});
              
          }
      });
      return false;
   });

  form.render();
});  
 
</script>  
<script>
  layui.cache.page = 'user';
  layui.config({
  base: '__PUBLIC__/theme/blueideal/mods/' //这里实际使用时，建议改成绝对路径
  }).extend({
    fly: 'index'
  }).use('fly');
</script>